package com.dily.study.demo.entity.jpa.enumdemo;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * Date: 2022-03-24 星期四
 * Time: 14:32
 * Author: Dily_Su
 * Remark:
 */
@Getter
public enum GradeEnum {
    PRIMARY(1, "小学"),
    SECONDARY(2, "中学"),
    HIGH(3, "高中");

    private final Integer code;
    private final String des;

    GradeEnum(Integer code, String des) {
        this.code = code;
        this.des = des;
    }

    @JsonValue
    public String getDes() {
        return des;
    }
}
